package com.app.Activity;

import java.util.ArrayList;

import com.app.outdoor.InvoikeServices.HeThongInvoike;
import com.app.outdoor.adapter.TinNhanAdapter;
import com.app.outdoor.pojo.TinNhanPOJO;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Button;
import android.widget.ListView;
import android.support.v4.app.NavUtils;

public class od_TinNhanActivity extends Activity {
	ArrayList<TinNhanPOJO> lstTinNhan;
	ListView lvTinNhan;
	TinNhanAdapter adapter;
	Button btnXoaHet;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.od_activity_tin_nhan);
		lvTinNhan = (ListView) findViewById(R.id.lvTinNhan);
		btnXoaHet=(Button)findViewById(R.id.btnXoaHet);
		getTinNhan();
		adapter = new TinNhanAdapter(this, lstTinNhan);
		lvTinNhan.setAdapter(adapter);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.od_activity_tin_nhan, menu);
		return true;
	}

	private void getTinNhan() {
		try {
			String data = HeThongInvoike.layTinNhan(CommonUtilities.nguoiDung.getId());
			lstTinNhan = TinNhanPOJO.parseArray(data);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
